package com.common.core.utils;

import java.util.Random;

import cn.hutool.core.util.IdUtil;

public class CodeGeneratorUtil {

    public static String generateCode(int length){
        Random random = new Random();
        StringBuilder code = new StringBuilder();
        for (int i = 0; i < length; i++) {
            code.append(random.nextInt(10));
        }
        return code.toString();
    }   

    public static long snowflake(){
        return IdUtil.getSnowflakeNextId();
    }
}